package com.example.productdataserviceprovider.service.hutool;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.EscapeUtil;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestHutool {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String a="开了一//堆无聊的会□□□□□";
//        String hexResult= Convert.toHex(a, CharsetUtil.CHARSET_UTF_8);
//        System.out.println(hexResult);
//        String source=Convert.hexToStr(hexResult, CharsetUtil.CHARSET_UTF_8);
//        System.out.println(source);
//        List<String> array1= Arrays.asList(new String[]{"33","44"});
//        List<String> array2= Arrays.asList(new String[]{"33","44"});
//        Map<List<String>,String> datas=new HashMap<>();
//        datas.put(array1,"小说");
//        datas.put(array2,"图书");
//        System.out.println(datas.size());
//        for(Map.Entry<List<String>,String> data:datas.entrySet()){
//            List<String> d=data.getKey();
//            System.out.println(d+","+data.getValue());
//        }
//        try {
//            String result= URLEncoder.encode(a,"UTF-8");
//            String source= URLDecoder.decode(result,"UTF-8");
//            System.out.println(result);
//            System.out.println("source="+source);
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }
        String  b=" / abc@ - _ + . / ";
        String result=EscapeUtil.escape(b);
        System.out.println(result);
        System.out.println(EscapeUtil.unescape(result));

    }
}
